feat(files): allow image uploads in workspace files#4419
feat(files): allow image uploads in workspace files#4419waleedlatif1 merged 3 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
PR SummaryLow Risk Overview Upload validation/attributes were updated by introducing Reviewed by Cursor Bugbot for commit 81f62ff. Configure here. |
1969271 to
277b344
Compare
277b344 to
143056c
Compare
Greptile SummaryThis PR fixes a bug where workspace file uploads were silently rejecting all image files because the Confidence Score: 5/5This PR is safe to merge — it fixes a clear bug with no regressions introduced. All previously flagged issues (missing SupportedImageExtension in SupportedMediaExtension, narrow SUPPORTED_IMAGE_MIME_TYPES) are resolved. The logic changes are straightforward, limited to the file picker accept attribute and UI filter labels, and follow the same pattern used for audio/video. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User opens workspace file picker] --> B[ACCEPT_ATTR built from SUPPORTED_EXTENSIONS]
B --> C{File extension in list?}
C -- "Yes (now includes images)" --> D[File accepted by browser picker]
C -- "No" --> E[File hidden/rejected by browser]
D --> F[File uploaded to backend]
F --> G[formatFileType called]
G --> H{mimeType check}
H -- "starts with image/" --> I["Label: Image"]
H -- "starts with audio/" --> J["Label: Audio"]
H -- "starts with video/" --> K["Label: Video"]
H -- "in MIME_TYPE_LABELS" --> L["Specific label: PDF, Word…"]
F --> M[Type filter applied]
M --> N{"typeFilter includes 'image'?"}
N -- "Yes" --> O["f.type?.startsWith('image/')"]
O -- true --> P[File shown in filtered view]
O -- false --> Q[File hidden]
Reviews (4): Last reviewed commit: "fix(files): match all image mime types i..." | Re-trigger Greptile |
143056c to
b72e737
Compare
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 81f62ff. Configure here.
|
@greptile-apps Disagreeing with this one. Looking at
None of the three helpers do extension-based fallback — the claim that audio/video helpers fall back to extensions is incorrect. A I deliberately didn't widen On the null-MIME concern: |
|
You're right on all counts — I was wrong about the extension fallback, and the deliberate scope isolation makes sense here. The inline Happy to defer to this approach.
|
Summary
acceptattribute had no image extensions, even though the backend accepts any file typeSUPPORTED_IMAGE_EXTENSIONS(png, jpg, jpeg, gif, webp, svg, bmp, tif, tiff, heic, heif, avif, ico) and included it in the workspace files pickerCHAT_ACCEPT_ATTRIBUTEType of Change
Testing
Tested manually
Checklist